<?php 
require_once substr(dirname(__FILE__),0,-1).'sub/init.php';
require_once ZEAI.'sub/conn.php';
require_once ZEAI.'m/my_chk_u.php';
/***********************主体入口***************************/
$fid = intval($fid);
if(!ifint($fid)){alert('参数丢失',"lovetest.php");}else{
	$rowS = $db->ROW(__TBL_LOVETEST_BANK__,"title,description,price,uids","id=".$fid,'name');
	if ($rowS){
		$title=dataIO($rowS['title'],'out');
		$description=dataIO($rowS['description'],'out');
		$price = $rowS['price'];
		$uids = dataIO($rowS['uids'],'out');
		$uidsArr = explode(",",$uids);
		$payflag=0;
		if($price!=0 && !in_array($cook_uid,$uidsArr)){$btnstr="支付（".$price." 元）测试";$payflag=1;}else{$btnstr="开始测试";}
	}else{
		alert('试题库不存在或已经删除',"-1");	
	}
}
$headertitle = '情感测试';?>
<!doctype html><html><head><meta charset="utf-8">
<title><?php echo $headertitle;?></title>
<?php echo HEADMETA; ?>
<meta name="x5-orientation" content="portrait">
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<link href="<?php echo HOST;?>/cache/zeaicolor.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<link href="<?php echo RES;?>m/css/qinggan.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<style>
.detail{position:relative;overflow:hidden;top:0;margin-top:5rem}
.detail h1{color:#fff;font-size:1.8rem;line-height:5rem}
.detail:after{width:200%;height:30rem;position:absolute;left:-50%;top:-20rem;z-index:-2;content:'';border-radius:0 0 50% 50%;background-size:50%}
.detail:before{content:'';position:absolute;top:0;left:0;width:100%;height:10rem;z-index:1;overflow:hidden;background-size:100%}
.detail .detail_box{width:94%;background-color:#fff;margin:0 auto 1.2rem auto;border-radius:1.6rem;padding:2rem 2.5rem 3rem 2.5rem;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;position:relative;z-index:1;box-shadow:0 0 2.4rem rgba(0,0,0,0.08)}
.detail h3{color:#333;font-weight:bold;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-bottom:#dbdbdb dotted .2rem;padding-bottom:2rem}
.detail p{text-align:left;color:#444;line-height:180%;margin-top:1.5rem;}
.qgbtn{border-radius:4rem;margin-top:2rem;box-shadow: 0 .3rem .8rem rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.4);}
.top_mini4{background-image:url("<?php echo RES;?>m/img/my_bg.png");background-size:100%}
.detail:before{background-image:url("<?php echo RES;?>m/img/my_bg.png");}
#backtop a,#btmKefuBtn{background-color:<?php echo $_ZEAI['mob_mbcolor'];?>}
<?php if ($_ZEAI['m_mb']==2){
	$mini_class='top_mini4';?>
	.detail .detail_box{margin-top:1.2rem}
<?php }else{
	$mini_class='top_mini4 zeaibg bgcolor';?>
	.detail:after{background-color:<?php echo $_ZEAI['mob_mbcolor'];?>}
<?php }?>
</style>
</head>
<body>
<?php 
$mini_title='情感测试';
require_once ZEAI.'m/top_mini.php';?>
<div class="detail">
	<div class="detail_box">
        <h3>《<?php echo $title;?>》</h3>
        <p><?php echo $description;?></p>
    </div>
</div>
<?php if(ifint($payflag)){?>
    <button id="gopay" class="btn size4 W90_ zeaibg qgbtn" clsid="<?php echo $price;?>" fid="<?php echo $fid;?>"><?php echo $btnstr;?></button><?php
	//if(ifint($cook_uid)){
		$row = $db->ROW(__TBL_USER__,"money","id=".$cook_uid);$cook_money = $row['money'];
		$jump_url = HOST.'/m/qinggan_ifpay.php?fid='.$fid;
		$money = floatval($price);
		$kind  = 22;
		echo '<input type="hidden" id="money" value="'.$money.'">';
		require_once 'my_pay.php';
	//}
}else{?>
<button class="btn size4 W90_ zeaibg qgbtn" onClick="zeai.openurl('qinggan_detail.php?fid=<?php echo $fid;?>')"><?php echo $btnstr;?></button>
<?php }?>
<div id="backtop"><a href="#top" id="btmTopBtn"><i class="ico">&#xe60c;</i>顶部</a></div>
<script>var is_weixin=<?php echo (is_weixin())?'true':'false';?></script>
<script src="<?php echo RES;?>m/js/qinggan.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<?php
if($_ZEAI['m_mb']==2){
	require_once ZEAI.'m/bottom2.php';
}else{
	require_once ZEAI.'m/TRnav.php';
	require_once ZEAI.'m/bottom.php';
}
?>